package com.sensetime.bi.senselink.server.rtsp.server.processor.localfile.actions;

import com.sensetime.bi.senselink.server.constant.Constant;
import com.sensetime.bi.senselink.server.entity.RtspRequestMsg;
import com.sensetime.bi.senselink.server.util.StringUtils;
import io.netty.handler.codec.http.DefaultHttpResponse;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.rtsp.RtspHeaderNames;
import io.netty.handler.codec.rtsp.RtspResponseStatuses;
import io.netty.handler.codec.rtsp.RtspVersions;

import java.util.concurrent.Callable;

public class OptionsAction  {
  private RtspRequestMsg request = null;

  public OptionsAction(RtspRequestMsg request) {
    this.request = request;
  }

  public String call() {
    return RtspVersions.RTSP_1_0.text() + StringUtils.SPACE + RtspResponseStatuses.OK.code() + Constant.CRLF +
            RtspHeaderNames.SERVER.toString() + ":" + "RtspServer" + Constant.CRLF +
            RtspHeaderNames.CSEQ + ":" + this.request.getCSEQ() + Constant.CRLF +
            RtspHeaderNames.PUBLIC + ":" + "SETUP,PLAY,PAUSE,TEARDOWN,GET_PARAMETER,OPTION" + Constant.CRLF;
  }

  public static void main(String[] args) {
    System.out.println(RtspVersions.RTSP_1_0.text());
  }
}
